<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            height: 100px;
            width: 100px;
            border: 1px solid #000;
            position: relative;
        }
        input{
            color: transparent;
            opacity: 0;
            position: absolute;
            height: 0;
            height: 100px;
            width: 100px;
        }
    </style>
</head>
<body>
<div class="container">
</div>
<button>+
    <input type="file">

</button>
<script src="http://unpkg.zhimg.com/jquery"></script>
<script>
    $('button').click(function(){
        $('.container').append(`
        <div class="box">
        <input type="file">
        </div>
        `)
        $('.box:last').trigger('click')
    })
    $('.container').on('change','.box',function(){
        const reader=new FileReader();
        reader.readAsDataURL($(this).find('input')[0].files[0])
            reader.onload=(e)=>{
                // $('.box').css('backgroundImage',$(e.target.result))
                $('.box').css({
                    backgroundImage: `url(${e.target.result})`,
                    backgroundSize : '100% 100% ' ,
                });
            }
    })
</script>
</body>
</html>